package com.trust.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.trust.entity.CheckoutDetail;
import com.trust.mapper.CheckoutDetailMapper;
import com.trust.service.CheckoutDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class CheckoutDetailServiceImpl extends ServiceImpl<CheckoutDetailMapper, CheckoutDetail> implements CheckoutDetailService {

    @Override
    public List<CheckoutDetail> getByCheckoutId(Integer checkoutId) {
        LambdaQueryWrapper<CheckoutDetail> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(CheckoutDetail::getCheckoutId, checkoutId);
        wrapper.orderByAsc(CheckoutDetail::getExamineSort);
        return this.list(wrapper);
    }
}
